﻿ #region Disclaimer/Info
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //
 //   File:		UrlBuilder.cs
 //   Website:		http://dexterblogengine.com/
 //   Authors:		http://dexterblogengine.com/About.ashx
 //   Rev:		1
 //   Created:		19/01/2011
 //   Last edit:		19/01/2011
 //   License:		GNU Library General Public License (LGPL)
 // 
 //   For updated news and information please visit http://dexterblogengine.com/
 //   Dexter is hosted to Codeplex at http://dexterblogengine.codeplex.com
 //   For any question contact info@dexterblogengine.com
 //
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
 #endregion

using Dexter.CallContext;
using Dexter.Logger.Contracts;

namespace Dexter.Services.Implementation {
	/// <summary>
	/// 	Implementation of <see cref = "IUrlBuilder" />.
	/// </summary>
	public class UrlBuilder : UrlBuilderBase , IUrlBuilder {
		readonly ICategoryUrlBuilder categoryUrlBuilder;
		readonly ICommentUrlBuilder commentUrlBuilder;
		readonly IPageUrlBuilder pageUrlBuilder;
		readonly IPostUrlBuilder postUrlBuilder;
		readonly ITagUrlBuilder tagUrlBuilder;
		readonly IBackOfficeUrlBuilder backOfficeUrlBuilder;
		readonly IUserUrlBuilder userUrlBuilder;
		readonly IExportUrlBuilder exportUrlBuilder;

		/// <summary>
		/// Initializes a new instance of the <see cref="UrlBuilder"/> class.
		/// </summary>
		/// <param name="logger">The logger.</param>
		/// <param name="context">The HTTP context.</param>
		/// <param name="configurationService">The configuration service.</param>
		/// <param name="pageUrlBuilder">The page URL builder.</param>
		/// <param name="postUrlBuilder">The post URL builder.</param>
		/// <param name="categoryUrlBuilder">The category URL builder.</param>
		/// <param name="tagUrlBuilder">The tag URL builder.</param>
		/// <param name="commentUrlBuilder">The comment URL builder.</param>
		/// <param name="backOfficeUrlBuilder">The back office URL builder.</param>
		/// <param name="userUrlBuilder">The user URL builder.</param>
		/// <param name="exportUrlBuilder">The export URL builder.</param>
		public UrlBuilder ( ILogger logger , IDexterContext context , IConfigurationService configurationService , IPageUrlBuilder pageUrlBuilder , IPostUrlBuilder postUrlBuilder , ICategoryUrlBuilder categoryUrlBuilder , ITagUrlBuilder tagUrlBuilder , ICommentUrlBuilder commentUrlBuilder , IBackOfficeUrlBuilder backOfficeUrlBuilder , IUserUrlBuilder userUrlBuilder , IExportUrlBuilder exportUrlBuilder ) : base ( logger , context , configurationService ) {
			this.pageUrlBuilder = pageUrlBuilder;
			this.exportUrlBuilder = exportUrlBuilder;
			this.userUrlBuilder = userUrlBuilder;
			this.backOfficeUrlBuilder = backOfficeUrlBuilder;
			this.commentUrlBuilder = commentUrlBuilder;
			this.tagUrlBuilder = tagUrlBuilder;
			this.postUrlBuilder = postUrlBuilder;
			this.categoryUrlBuilder = categoryUrlBuilder;
		}

		public virtual IPostUrlBuilder Post {
			get { return postUrlBuilder; }
		}

		public virtual IPageUrlBuilder Page {
			get { return pageUrlBuilder; }
		}

		public virtual ICategoryUrlBuilder Category {
			get { return categoryUrlBuilder; }
		}

		public virtual ITagUrlBuilder Tag {
			get { return tagUrlBuilder; }
		}

		public virtual ICommentUrlBuilder Comment {
			get { return commentUrlBuilder; }
		}

		public IBackOfficeUrlBuilder BackOffice {
			get { return backOfficeUrlBuilder; }
		}

		public IUserUrlBuilder User {
			get { return userUrlBuilder; }
		}

		public IExportUrlBuilder Export {
			get { return exportUrlBuilder; }
		}
	}
}
